<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            position: relative;
            width: 200px;
            height: 200px;
            margin: 100px auto;
            /* 景深 透视 */
            /* perspective: 4000px; */
            transition: 2s;
            transform-style: preserve-3d;
        }
        .box div{
            /* 块级元素水平垂直居中 */
            position: absolute;
            left:0;
            top: 0;
            width: 200px;
            height: 200px;
            background-color: red;
            opacity: 0.5;
        }
        /* 立方体左侧 */
        .box div:nth-child(2){
            background-color: orange;
            transform: translateX(-100px) rotateY(90deg);
        }
        /* 右侧 */
        .box div:nth-child(3){
            background-color: pink;
            transform: translateX(100px) rotateY(90deg);
        }

        /* 上侧 */
        .box div:nth-child(4){
            background-color: red;
            transform: translateY(-100px) rotateX(90deg);
        }
        /* 下册 */
        .box div:nth-child(5){
            background-color: purple;
            transform: translateY(100px) rotateX(90deg);
        }

        /* 前 */
        .box div:nth-child(1){
            background-color: green;
            transform: translateZ(100px);
        }
        /* 后 */
        .box div:nth-child(6){
            background-color: blue;
            transform: translateZ(-100px);
        }

        .box:hover{
            /* rotate3d(x,y,z,angle) */
            /* transform: rotate3d(1,1,0,360deg); */
            transform: rotateX(360deg) rotateY(360deg);
        }
    </style>
</head>
<body>
    <div class="box">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
    </div>
</body>
</html>